package org.asociacion.backend.persistence.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.asociacion.backend.bo.EnumImageType;
import org.hibernate.annotations.Type;

@Entity
@Table(name="tbl_index_image", catalog="asociacion")
public class TblIndexImage {
	
	@Id
	@Column
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@Column(nullable=false)
	private String name;
	
	@Column(nullable=false)
	@Type(type="org.hibernate.type.BinaryType")
	private byte[] image;
		
	@Column(nullable=false)
	@Enumerated(EnumType.STRING)
	private EnumImageType type;

	@ManyToOne
	@JoinColumn(name="tbl_index_image_folder_id", nullable=false)
	private TblIndexImageProperties tblIndexImageProperties;
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public byte[] getImage() {
		return image;
	}

	public void setImage(byte[] image) {
		this.image = image;
	}

	public EnumImageType getType() {
		return type;
	}

	public void setType(EnumImageType type) {
		this.type = type;
	}

	public TblIndexImageProperties getTblIndexImageProperties() {
		return tblIndexImageProperties;
	}

	public void setTblIndexImageProperties(
			TblIndexImageProperties tblIndexImageProperties) {
		this.tblIndexImageProperties = tblIndexImageProperties;
	}

}
